/* Copyright 2001,2002,2003 NAH6 BV
 * All Rights Reserved
 *
 *  $Header: /var/lib/cvs/secphone/ui/phone/Vibrator.h,v 1.3 2003/11/21 12:39:24 itsme Exp $
 *
 *
 */


#ifndef __VIBRATOR_H__

#include "nhThread.h"

class Vibrator : public NHThread {
public:
    Vibrator();
    ~Vibrator();

    void on();
    void off();
    void blink(int onMsec, int offMsec);
    void metablink(int onMsec, int offMsec, int onCycles, int offCycles);

protected:
    virtual DWORD ThreadProc();
    virtual const char* name() const { return "Vibrator"; }

private:
    int m_lednr;

    HANDLE m_hChangeEvent;

    enum { MODE_OFF, MODE_ON, MODE_BLINK } m_mode;
    enum { STATE_OFF, STATE_ON } m_state;
    enum { META_OFF, META_ON } m_metastate;
    int m_metacycle;

    int m_onMsec;
    int m_offMsec;
    int m_onCycles;
    int m_offCycles;

};

#define __VIBRATOR_H__
#endif
